<?php

include('config.php');
session_start();
draw_header('Error');
if (!isset($_SESSION['uid']))
{
        draw_menu();
}
else
{
        draw_menu($_SESSION['uid']);
}

@draw_status_bar('Error', $_REQUEST['last_message']);

switch ($_REQUEST['ec'])
{
case 0:
$message = 'There was an error logging you in. <a href="'.$GLOBALS['CONFIG']['base_url'].'">Please try again.</a>';
break;

case 1:
$message = 'Please <a href='.$GLOBALS['CONFIG']['base_url'].'>log in</a> again.';
break;

case 2:
$message = 'There was an error performing the requested action. Please <a href='.$GLOBALS['CONFIG']['base_url'].'>log in</a> again.';
break;

case 3:
$message = 'Record already exists. Try again with a different value.';
break;

case 4:
$message = 'You are not an administrator. <a href=out.php>Back</a>';
break;

case 5:
$message = 'Category '.$_REQUEST['category'].' already exists! <a href=out.php>Back</a>';
break;

case 6:
$message = 'You did not enter a value! <a href=out.php>Back</a>';
break;


case 11:
$message = 'Please upload a valid document.';
break;

case 12:
$message = 'You must assign view/modify rights to at least one user.';
break;

case 13:
$message = 'That file type is not currently supported.<p>Please upload a document conforming to any of the following file types or add the missing MIMETYPE to config.php->allowedFileTypes:<br><ul align=left>';

	foreach($GLOBALS['allowedFileTypes'] as $thistype)
	{
		$message .= '<li>'.$thistype;
	}
$message .= '</ul>';
break;

case 14:
$message = 'Non-unique account.  Please contact '.$GLOBALS['CONFIG']['site_mail'].' for help.';
break;

case 15:
$message = 'Error: wrong file!  Please check in the right file.';
break;

case 16: 
$message = 'Non-unique key field in database.';
break;

case 17: 
$message = 'This file cannot be checked in';
break;

case 18:
$message = 'This file cannot be uploaded propertly';
break;

case 19:
$message = 'You do not currently have an account. Please contact <a href="mailto:' . $GLOBALS['CONFIG']['site_mail'] . '"> ' . $GLOBALS['CONFIG']['site_mail'] . '</a> to request one.';
break;

case 20:
$message = 'This operation cannot be done to a revision of a file';
break;

case 21:
$message = 'This operation cannot be done on this file';
break;

case 22:
$message = 'Unable to determine the root username.  Please check your config file';
break;

case 23:
$message ='Folder Error. Check Last Message in status bar for details'; 
break;

case 24:
$message ='This page requires root clearance level.';
break;

case 25:
$message ='The file is too large. Max size is ' . $GLOBALS['CONFIG']['max_filesize'];
break;

default:
$message = 'There was an error performing the requested action. Please <a href='.$GLOBALS['CONFIG']['base_url'].'>log in</a> again.';
break;
}
echo('<img src="images/exclamation_red.gif"> <font size="4" color="red">' . $message . '</font>');
draw_footer();
?>
